﻿using System;

namespace Murry.DataStore.WebApiDB
{
    /// <summary>
    /// Web API implementation of IReadOnlyDataStore
    /// </summary>
    public class ReadOnlyWebApiDataStore : ReadOnlyDataStore<string>
    {
        /// <summary>
        /// Construct with a URI string.
        /// </summary>
        /// <param name="uriBase">URI base.</param>
        public ReadOnlyWebApiDataStore(string uriBase)
        {
            Database = uriBase;
        }

        /// <summary>
        /// Helper method to register entities.
        /// </summary>
        /// <param name="interfaceType">Interface type.</param>
        /// <param name="implementationType">Implemented type.</param>
        public static void RegisterEntity(Type interfaceType, Type implementationType)
        {
            Entities.AddEntity(typeof(ReadOnlyWebApiDataStore), interfaceType, implementationType);
        }

    }
}
